
#include "geomSetupCircle.h"


geomSetupCircle::geomSetupCircle()
{
    QString lenUnit = "mm";

    tb_build = new QToolButton();
    tb_build->setText("构建");
    tb_build->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_build->setIconSize(QSize(20, 20));
    tb_build->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_build->setAutoRaise(true);

    label_size = new QLabel();
    label_size->setText("尺寸");
    label_size->setStyleSheet("background-color: #B9D1ED;");
    label_r = new QLabel();
    label_r->setText("半径：");
    lineEdit_r = new QLineEdit();
    label_r_unit = new QLabel();
    label_r_unit->setText(lenUnit);

    label_pos = new QLabel();
    label_pos->setText("位置");
    label_pos->setStyleSheet("background-color: #B9D1ED;");
    label_x = new QLabel();
    label_x->setText("x：");
    lineEdit_x = new QLineEdit();
    label_x_unit = new QLabel();
    label_x_unit->setText(lenUnit);
    label_y = new QLabel();
    label_y->setText("y：");
    lineEdit_y = new QLineEdit();
    label_y_unit = new QLabel();
    label_y_unit->setText(lenUnit);

    vSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
    int i = 0;
    gl->addWidget(tb_build, i, 0, 1, 2);
    // size
    gl->addWidget(label_size,   ++i, 0, 1, 3);
    gl->addWidget(label_r,      ++i, 0, 1, 1);
    gl->addWidget(lineEdit_r,   i,   1, 1, 1);
    gl->addWidget(label_r_unit, i,   2, 1, 1);
    // position
    gl->addWidget(label_pos,    ++i, 0, 1, 3);
    gl->addWidget(label_x,      ++i, 0, 1, 1);
    gl->addWidget(lineEdit_x,   i,   1, 1, 1);
    gl->addWidget(label_x_unit, i,   2, 1, 1);
    gl->addWidget(label_y,      ++i, 0, 1, 1);
    gl->addWidget(lineEdit_y,   i,   1, 1, 1);
    gl->addWidget(label_y_unit, i,   2, 1, 1);

    gl->addItem(vSpacer, ++i, 1, 1, 1);
}

